Repository navigation
test(autoreview): isolate review-scope-test's git from host config - #1176
Draft
sbalabanov wants to merge 1 commit into
Draft
sbalabanov wants to merge 1 commit into
sbalabanov wants to merge 1 commit into
Conversation
On hosts whose system git config enables commit signing, test_branch_mode_uses_the_net_worktree_diff failed every run: its `git commit` exited 128 because the signing helper was unavailable in the test sandbox. The test's run_git helper ran host git with the inherited environment, so system and global config (signing, hooks) leaked into the temporary repository. run_git now sets GIT_CONFIG_NOSYSTEM=1 and GIT_CONFIG_GLOBAL=/dev/null, so only the repository's own config (the test's user.email and user.name) applies. The script invocations are unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
sbalabanov
commented
Dec 3, 2026
sbalabanov
left a comment
Collaborator
Author
There was a problem hiding this comment.
[flaky-1-d4-reviewer] satisfied: the run_git env now keeps system, global and XDG git config out of every git call the test makes (checked against a host with system signing and hooks); the script it runs only reads and keeps the caller's config, as the spec intends; scope, comments, commit message and PR body all pass.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR:
review-scope-testnow ignores system and global git config, so it passes on hosts that enable commit signing.Summary
run_gitinreview_scope_test.pyran host git with the inherited environment. On a host whose system git config enables commit signing,git commitintest_branch_mode_uses_the_net_worktree_diffexited 128 on every run.run_gitnow setsGIT_CONFIG_NOSYSTEM=1andGIT_CONFIG_GLOBAL=/dev/null. The test's own repo-leveluser.emailanduser.namestill apply, and the script invocations are unchanged..claude/skillsalias is a symlink, so both targets are covered.Test Plan
On a host with system
commit.gpgsign=trueand a system hooks path:./tool/bazel test //.agents/skills/autoreview/scripts:review-scope-test //.claude/skills/autoreview/scripts:review-scope-test --nocache_test_results: both FAILED.--runs_per_test=20 --runs_per_test_detects_flakes --nocache_test_results: 20/20 pass on each.make lint check-gazelle check-tidy: pass.🤖 Generated with Claude Code